// 此处用于存放登录相关的请求
import request from '@/utils/request'

export const getGraphCodeImg = () => {
  return request.get('/captcha/image')
}

export const getSmsCode = (captchaCode, captchaKey, mobile) => {
  return request.post('/captcha/sendSmsCaptcha', {
    from: { captchaCode, captchaKey, mobile }
  })
}

export const login = (mobile, smsCode) => {
  return request.post('/passport/login', {
    form: {
      isParty: false,
      mobile,
      partyData: {},
      smsCode
    }
  }, {
    headers: {
      platform: 'H5'
    }
  })
}
